<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:composition template="../template.xhtml">
    <ui:define name="content">
        <h:form id="resultForm">
            <div class="container">
                <h:panelGroup id="inputPanel" layout="block" style="display: inline-block" >
                    <div><p:messages showIcon="true" globalOnly="true" id="messages"/></div>
                    <div style="display: inline-block; text-align: left; font-size: 30px">
                        <div>
                            <h:outputText style="font-size: 34px" value="#{registerResultBean.homePlayerName}"/>
                        </div>
                        <div style="font-size: 15px">vs</div>
                        <div>
                            <p:autoComplete style="font-size: 30px; box-shadow:none; outline: medium none; transition: none 0s ease 0s;" forceSelection="true" placeholder="Opponent"
                                            value="#{registerResultBean.awayPlayerName}" required="true"
                                            completeMethod="#{registerResultBean.selectablePlayerNames}"/>
                        </div>
                    </div>
                    <div style="display: inline-block;">
                        <div style="display: inline-block;">
                            <div>
                                <h:inputText id="set1P1" class="setInput"
                                             value="#{registerResultBean.set1.gamesPlayer1}"
                                             required="true" maxlength="1" styleClass="setInput">
                                    <f:convertNumber integerOnly="true"/>
                                </h:inputText>
                            </div>

                            <div>
                                <h:inputText id="set1P2" class="setInput"
                                             value="#{registerResultBean.set1.gamesPlayer2}"
                                             required="true" maxlength="1" styleClass="setInput">
                                    <f:convertNumber integerOnly="true"/>
                                </h:inputText>
                            </div>
                        </div>

                        <div style="display: inline-block;">
                            <div>
                                <h:inputText id="set2P1" class="setInput"
                                             value="#{registerResultBean.set2.gamesPlayer1}"
                                             required="false" maxlength="1" styleClass="setInput">
                                    <f:convertNumber integerOnly="true"/>
                                </h:inputText>
                            </div>
                            <div>
                                <h:inputText id="set2P2" class="setInput"
                                             value="#{registerResultBean.set2.gamesPlayer2}"
                                             required="false" maxlength="1" styleClass="setInput">
                                    <f:convertNumber integerOnly="true"/>
                                </h:inputText>
                            </div>
                        </div>
                        <div style="display: inline-block;">
                            <div>
                                <h:inputText id="set3P1" class="setInput"
                                             value="#{registerResultBean.set3.gamesPlayer1}"
                                             required="false" maxlength="1" styleClass="setInput">
                                    <f:convertNumber integerOnly="true"/>
                                </h:inputText>
                            </div>

                            <div>
                                <h:inputText id="set3P2" class="setInput"
                                             value="#{registerResultBean.set3.gamesPlayer2}"
                                             required="false" maxlength="1" styleClass="setInput">
                                    <f:convertNumber integerOnly="true"/>
                                </h:inputText>
                            </div>
                        </div>
                    </div>
                    <div style="text-align: left; margin-top: 20px">
                        <div style="display: inline-block">
                            <p:calendar pattern="yyyy-MM-dd" timeZone="CET" id="popup" value="#{registerResultBean.matchDate}" placeholder="When" required="true"/>
                        </div>
                    </div>

                    <div style="text-align: left; margin-top: 10px">
                        <p:commandButton value="Save" actionListener="#{registerResultBean.save}"
                                         update="inputPanel" action="/results.xhtml"/>
                    </div>
                </h:panelGroup>
            </div>
        </h:form>
    </ui:define>
</ui:composition>
</html>
